require(['./config'],() => {
    require(['swiper','template','request','bootstrap','header','footer'],(Swiper,template,req) => {
        class Index{
            constructor(){
              this.init()
              this.getIndexProd()
            }
            init(){
              var swiper = new Swiper('.swiper-container', {
                spaceBetween: 30,
                centeredSlides: true,
                autoplay: {
                  delay: 2500,
                  disableOnInteraction: false,
                },
                pagination: {
                  el: '.swiper-pagination',
                  clickable: true,
                },
                navigation: {
                  nextEl: '.swiper-button-next',
                  prevEl: '.swiper-button-prev',
                },
              });
            }
            getIndexProd(){
              // console.log(req)
              req.getIndexName()
                .then(res =>{
                     if(res.code === 200){
                        const html = template('indexProdTemplate',{date:res.date})
                        $('.brief_xia').html(html)
                    }
                })
            }
        }
        return new Index()
    })
})